<div id="qujia" style="display:none;">
    <div class="qujia_box yh">
        <form id="qujiaForm" onsubmit="return false">
            <div class="form-box fn-clear">
                <label><font class="label">剩 余</font>： </label>
                <b id="leftTime_qujia" class="color01">请稍等, 正在载入中...</b>
            </div>

            <div class="form-box fn-clear">
                <label><font class="label">出 价</font>： </label>
                <select name="price" id="price">
                    {foreach from=$data.priceList item=m}
                    <option value="{$m}">{$m|price_format}</option>
                    {/foreach}
                </select>
                <label style="font-size:12px;"><input type="checkbox" name="auto" id="auto" value="1" />系统自动配价</label>
            </div>

            <div class="form-box fn-clear">
                <label><font class="label">资金密码</font>： </label>
                <input type="password" id="password_pay" name="password_pay" class="input" tabIndex="1" />
                <span class="tips_password"><a href="{url('/member/chpaypass')}">
                    {if $data.is_mobile}
                    手机后六位
                    {else}
                    忘记资金密码？
                    {/if}
                </a></span>
            </div>

            <div class="form-box fn-clear">
                <label><font class="label">安全验证</font>： </label>
                <input type="text" name="scode" id="scode" class="input" maxlength="4" tabIndex="2" />
                <img src="/welcome/scode" class="imgcode" onclick="this.src='/welcome/scode?xrand='+Math.random();" style="vertical-align: middle" />
            </div>

            <div class="pujia-button">
                <a href="javascript:;" onclick="submitQj()">确 定</a>
            </div>

            <input name="id" id="id" type="hidden" value="{$data.row.act_id}" />
        </form>
    </div>
</div>

<script type="text/javascript" src="/style/jquery.form.js"></script>
<script type="text/javascript">
    onload_leftTime('_qujia',"{$data.row.diff_time}","{$data.row.status}");

    //自动配价
    $('#auto').bind('click',function(){
        if($(this).is(':checked')){
            $('#price').hide();
        }else{
            $('#price').show();
        }
    }).click();

    //出价弹窗
    $('#qjA').click(function(){
        art.dialog({
            id: 'art_qujia',
            fixed: true,
            lock: true,
            ok: false,
            padding: '20px 30px',
            title: "{$L.unit_pay}出价",
            content: document.getElementById('qujia')
        });
        if($('#password_pay').length>0) $('#password_pay').focus().val('');
        if($('.imgcode').length>0) $('.imgcode').click();
    });

    //提交
    function submitQj(){
        if($.trim($('#password_pay').val())==''){
            layer.msg('请输入资金密码',1);
            return false;
        }
        art.dialog.list['art_qujia'].close();

        var D = $('#qujiaForm').formSerialize();
        $.post("/auction/bid", D,
            function(data){
                if(data.msg){
                    var params = ' ';
                    if(data.url){
                        params = function(){
                            location.href=data.url;
                        };
                    }
                    layer.alert(data.msg,data.type?data.type:8,params);
                }
                if(data.count>0) $('#BidCount').html(data.count);
                if(data.price>0){
                    $('#CurPrice').html(data.price);
                    load_log(true);
                }
            },"json");
        return false;
    }
</script>